import type { CardProps } from 'antd';
import { Card } from 'antd';
import React from 'react';
const Meta = Card.Meta;

export interface ImageCoverCardProps extends Pick<CardProps, 'onClick' | 'style' | 'bodyStyle'> {
  title?: string;
  description?: string;
  coverSrc?: string;
  coverStyle?: React.CSSProperties;
}

export function ImageCoverCard({ title, description, coverSrc, coverStyle, ...rest }: ImageCoverCardProps) {
  return (
    <Card hoverable {...rest} cover={<img alt="cover-img" src={coverSrc} style={coverStyle} />}>
      <Meta title={title} description={description} />
    </Card>
  );
}
